<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Card\Model;
use Think\Model;
/**
 * Description of pvModel
 *
 * @author 薛鹏
 */
class pvModel extends Model {
    public function addPV($data)
    {
        return M('pv')->add($data);
    }
    public function existPV($pageType, $date)
    {
        return M('pv')->where([
            'page_type' => $pageType,
            'add_time' => $date
        ])->getField('id');
    }
    public function incPV($id)
    {
        return M('pv')->where([
            'id' => $id
        ])->setInc('num');
    }
}
